package com.zzy.ecommerce.dao;

import com.zzy.ecommerce.domain.TAccount;
import com.zzy.ecommerce.domain.TUser;

import java.util.List;

import org.apache.ibatis.annotations.*;

@Mapper
public interface TUserMapper {

    @Insert("insert into t_user(username,password) values(#{username},#{password}) ")
    Integer insert(TUser record);

    @Select("select id from t_user where userName=#{userName} and passWord=#{passWord}")
    Integer selectOneUser(String userName,String passWord);

    @Delete("delete from t_user")
    Integer deleteAllUsers();

    @Select("select * from t_user where username=#{username}")
    TUser selectOneUserByUserName(String username);

    @Select("select * from t_user where id=#{userid}")
    TUser selectOneUserById(Integer userid);

    @Update("update t_user set passWord=#{password} where id=#{id}")
    Integer updateAccount(String password,Integer id);

}